Remove R/rpy2 dependency; replace with cffdrs_py#5176
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #5176 +/- ##
==========================================
- Coverage 69.06% 69.06% -0.01%
==========================================
Files 394 393 -1
Lines 16418 16337 -81
Branches 1846 1820 -26
==========================================
- Hits 11339 11283 -56
+ Misses 4495 4479 -16
+ Partials 584 575 -9 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Where does this happen? I think cffdrs_py still handles it internally |
|
Took me awhile to figure out what was happening here, I was confused because R doesn't have fuel type default handling in those functions either, but it comes down to Python vs R math operations on
This is why C6 fuel type has built in 2 and 7m CBH on the front end Regardless, all the calculations in FireCalc look the same to me |
dgboss
left a comment
There was a problem hiding this comment.
🚀 So nice to finally remove R! We've been talking about this since I joined the team I think.
|
Do you think we should remove R installation and setup from |
|
Done in: c9c728a |
| crown_base_height=requested_station.crown_base_height, | ||
| crown_base_height=requested_station.crown_base_height | ||
| if requested_station.crown_base_height is not None | ||
| else FUEL_TYPE_DEFAULTS[requested_station.fuel_type]["CBH"], |
There was a problem hiding this comment.
cffdrs_py has crown_base_height and crown_fuel_load. Wondering if we should start using those vs our FUEL_TYPE_DEFAULTS. Or if that's a later ticket. PC, PDF and CC might be harder to sort out
There was a problem hiding this comment.
Yeah let's do a follow up if we didn't use that before from the R package.



Replaces all
R/rpy2calls inapp/fire_behaviour/cffdrs.pywith the pure-Pythoncffdrs_pypackage, eliminating the R runtime as a dependency.Changes:
cffdrs.pyto usecffdrs_pysubmodule importsr_importer.py, and CFFDRS pre-warming from startuprpy2frompyproject.toml; addedcffdrsgit dependency (pinned to commit)bui_calc, initial_spread_index, fire_weather_index, and crown_fraction_burned; fixed drought_code silently substitutingrh=0when RH is None; fixedl
ength_to_breadth_ratioreturning rather than raisingCFFDRSException; added per-row error handling tohourly_fine_fuel_moisture_codefba_calctests (removedCFFDRS.instance()pre-warming); deletedtest_r.pyBehavioural notes:
duff_moisture_code returns0.0 (not ~0.256) when temperature < 1.1°C —cffdrs_pyclamps temp to -1.1 before computing the drying rate (Eq. 16), zeroing it out. The R implementation did not apply this clamp.cbhuses a fuel type default if it isNone, this was handled internally before in the R library.Closes #1926
Test Links:
Landing Page
MoreCast
Percentile Calculator
C-Haines
FireCalc
FireCalc bookmark
Auto Spatial Advisory (ASA)
HFI Calculator
SFMS Insights
Fire Watch